//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __USBNETCARD_H__
#define __USBNETCARD_H__

#define DRVINITALIZE    0x00000001
#define ENABLEIRQ       0x00000002
#define DISABLEIRQ      0x00000003
#define DRVSHUTDOWN     0x00000004



class USBNetCard : public CDeviceDriver
{
   public:
    CARAPI Read(
        /* [in] */ Int64 u64Offset,
        /* [in] */ Int32 bytesToRead,
        /* [out] */ MemoryBuf * pBuffer,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Write(
        /* [in] */ Int64 u64Offset,
        /* [in] */ const MemoryBuf & buffer,
        /* [out] */ Int32 * pBytesWritten,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Control(
        /* [in] */ Handle32 nControlCode,
        /* [in] */ const MemoryBuf & inBuffer,
        /* [out] */ MemoryBuf * pOutBuffer,
        /* [out] */ IEvent * * ppCompletionEvent);

    virtual void Dispose();
    USBNetCard();
    private:
        ECode getAddressByUSB();
        ECode sendAddressConfirm();
        bool m_hasStarted;
};

#endif//__USBNETCARD_H__
